<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        // identifier 标识符， 
        function myConst(identifier, value) {
            Object.defineProperty(window, identifier, {
                value,
                writable: false
            })
        }

        myConst('name', '舒文俊')
        console.log(name)
        name = 'fdsafasd'
        console.log(name)
    </script>
</body>

</html>